<me:UILMFKART x:Class="WPFExcelReport.TLMFKART"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UILMFKART.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/> 
        <ucd:NOTConverter  x:Key="not"/> 
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>  
    </me:UILMFKART.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel  >
                <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="20" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <SD:TS0352  KEY="{Binding CARDNO,ElementName=TV}" />  
            </WrapPanel>
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0"  >
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel>
                    <WrapPanel>
                        <Grid Margin="10,0,0,0"  >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="EditCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0"  >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Delete.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0"  >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <Image Grid.Column="1" Source="/ImagePackage;component/Images/star.png" Visibility="{Binding IsChangedExt,Converter={StaticResource bv}}"/>
                        </Grid> 
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <SD:TS0352   KEY="{Binding CARDNO,ElementName=TV}"  />
                            <TextBlock  Grid.Column="1" Text="{Binding Source={Localization:Translate Word=新色号:}}"  FontSize="18"></TextBlock>
                            <ex:TXT72 Width="60" Text="{Binding FARBE ,Converter={StaticResource gb2312}}"  Grid.Column="2" TabIndex="601" FontSize="18"  MaxLength="10"  CharacterCasing="Upper"    />
                        </Grid> 
                    </WrapPanel>
                    <WrapPanel>
                        <Grid Margin="10,0,0,0" IsEnabled="False">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                            <ex:TXT72 Text="{Binding LMFFARBE,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"   Grid.Column="1" TabIndex="601" IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"  MaxLength="24"  CharacterCasing="Upper"  Width="40" />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=简述:}}"/>
                            <ex:TXT72 Text="{Binding LMFBEZ,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"  Grid.Column="1" TabIndex="602" IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"  
                                      MaxLength="20"   CharacterCasing="Upper"    Width="180" />
                        </Grid>
                        <SD:TSSD0561 KEY="{Binding CGRP,ElementName=TV}"/>
                    </WrapPanel> 
                </StackPanel>
                <DataGrid  Grid.Row="1"  
                   MaxHeight="400"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="2" Margin="0,0,0,0"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=LMFKARTNR,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色组}}"  Width="Auto" /> 
                        <DataGridTextColumn Binding="{Binding Path=LMFFARBE,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFBEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFPREISGRP,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=分组}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFAENDBEN,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=更改}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFAENDDAT,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFNEUBEN, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=LMFNEUDAT,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >
                <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
            </Grid>
        </Border>
    </Grid>
</me:UILMFKART>
